<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>
  <body>
    文字水平居中<br />
    1.块级元素,水平居中，text-align:center;<br>
    <div
      style="background: yellow;box-shadow: 0 0 12px 0 red;text-align: center;"
    >
      文字水平居中1
    </div>
    <h3 style="text-align: center;">文字水平居中2</h3>
  </body>
</html>
